package com.borqs.samples;

import java.util.*;
import android.util.TimeUtils;
import android.text.format.Time;

public class Util {
    public static String getTime(long mills){
        Time time = new Time();
        time.set(mills);
        return time.format("%Y/%m/%d_%H:%M:%S");
    }
    public static String getTimeDuration(long begin,long end){
        StringBuilder sb = new StringBuilder();
        TimeUtils.formatDuration(end - begin,sb);
        String s = sb.toString();
        return s;
    }
    public static String getTimeDuration(long duration){
        StringBuilder sb = new StringBuilder();
        TimeUtils.formatDuration(duration,sb);
        String s = sb.toString();
        return s;
    }
}
